Discover define constant variable, include the articles, news, trends, analysis and practical advice about define constant variable on alibabacloud.com
Constants must be defined before they are used, or the program execution will fail. Use the Define () function in the PHP tutorial to define constants.
1. Syntax format: define ("Constant name", "Constant value");
For example: Define ("php360",
Memory Allocation and variable storage location (heap, stack, method zone constant pool, method zone static zone), constant static
Source: http://www.cnblogs.com/protected/p/6419217.html
Intrusion and deletion!
When the program is running, data
A constant must be defined before use; otherwise, an error occurs during program execution. In the php Tutorial, use the define () function to define constants.1. Syntax format: define ("constant name", "constant value ");Example: define ("php360", "
Constant (volume) pointersA constant pointer is a pointer to a constant that we refer to as the name implies.
Pointing to constant variables with constant pointersIn fact, the C + + rule can only use the pointer to the constant variable, the normal
3.2.2 Constantsand variables can be used in the program to express those that may change the amount of data corresponding to, in C + +, we use constants to express those always remain unchanged data volume. In simple terms, the values, characters,
There is a constant DATA_PATH, and a string & quot; file_name & quot; how to define a variable in the class (the constant seems to need 5.7), which indicates DATA_PATH and & quot; file_name & quot;. I can define it outside the class as follows:
3.2.2 Constantsand variables can be used in the program to express those that may change the amount of data corresponding to, in C + +, we use constants to express those always remain unchanged data volume. In simple terms, the values, characters,
I. Usage of typedef:
①Define a type of Alias, not just a simple macro replacement. It can be used to declare multiple objects of the pointer type at the same time. Trap: typedef char * tchar;
Tchar Pa, PB; // Pa and Pb are pointer types. # Define
in our previous article, we introduced the use of PHP define examples, I believe that we have a certain understanding of define, today we introduce you to the PHP constant define and the difference between const detailed!
A constant is a simple
PHP variable Constant Definition method
A description of the definitions for some common static constants under PHP.
1. Defining constants
Define ("CONSTANT", "Hello World");
Constants can only contain scalar data (boolean,integer,float and string).
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.